package com.fyy.service;

import com.fyy.model.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@Component(value = "userService")
//value:微服务名称 fallbackFactory:服务降级
@FeignClient(value = "peo8081",fallbackFactory = IUserServiceFallFatory.class)
public interface IUserService {

    @GetMapping("/api/user/add")
    public boolean addUser(User user);

    @GetMapping("/api/user/query/{id}")
    public User queryUserById(@PathVariable("id")Long id);

    @GetMapping("/api/user/query")
    public List<User> queryUserList();


}
